package com.sunshine.spring.jdbc.model;

import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @Author: WeiHong
 * @Date: 2017/3/16 18:22
 */
public class CustomerRowMapper implements RowMapper {
    @Override
    public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
        Customer customer = new Customer(
                rs.getInt("CUST_ID"),
                rs.getString("NAME"),
                rs.getInt("AGE"));
        return customer;
    }
}
